package org.budo.dubbo.protocol.http.dispatcher.cometd;

import org.cometd.bayeux.server.BayeuxServer;
import org.cometd.bayeux.server.ConfigurableServerChannel;
import org.cometd.bayeux.server.ServerChannel;
import org.cometd.bayeux.server.ServerChannel.MessageListener;

/**
 * @author lmw
 */
public class ServerChannelListener implements BayeuxServer.ChannelListener {
    private MessageListener messageListener;

    public ServerChannelListener(ServerChannel.MessageListener messageListener) {
        this.messageListener = messageListener;
    }

    @Override
    public void channelAdded(ServerChannel serverChannel) {
        serverChannel.addListener(this.messageListener);
    }

    @Override
    public void configureChannel(ConfigurableServerChannel channel) {}

    @Override
    public void channelRemoved(String channelId) {}
}